<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!--完结审核弹窗  -->

<div  class="content-warp">
    <div class="distribPersonel" id="transferOrderPageBox" style="padding: 20px 20px">
        <form action="" id="transferOrderBoxForm" >
            <div class="table-warp">
                <c:if test="${isShow eq true}">
                    <table class="cell-border crm-table columnsHidden dataTable" id="orderTable">
                        <tr style="text-align: center">
                            <td><b>序号</b></td>
                            <td><b>生产单编号</b></td>
                            <td><b>合同编号</b></td>
                            <td><b>操作</b></td>
                        </tr>
                        <c:forEach items="${orderList}" var="order" varStatus="status">
                            <tr style="text-align: center">
                                <td>${status.index + 1}</td>
                                <td>${order.scProductOrderNo}<input name="subOrderIds" type="hidden" value="${order.id}"></td>
                                <td>${order.contractNo}</td>
                                <td>
                                    <a href="JavaScript:void(0);" class="layui-btn layui-btn-orange"
                                           onclick="removeOrder(this)">剔除</a>
                                </td>
                            </tr>
                        </c:forEach>
                    </table>
                </c:if>
            </div>
            <div class="table-warp">
                <span class="required">审核结果：</span>
                <label class="ali-radio"><input type="radio" name="auditResult" value="1" checked>同意</label>
                <label class="ali-radio"><input type="radio" name="auditResult" value="0">驳回</label>
            </div>
            <div class="table-warp">
                <p>
                    <label>备注：</label>
                </p>
                <textarea class="textarea-style" rows="4" name="remark" id="remark" placeholder="请填写备注,1-100字" maxlength="100"></textarea>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    function removeOrder(obj) {
        var num = $("#orderTable").children().children("tr").length;
        console.log(num);
        if(num == 2){
            DGG.Errors('请至少保留一个订单!');
            return;
        }
        $(obj).parent().parent().remove();
    }
</script>





